package com.atldy.commerce.feign;

import com.atldy.commerce.commence.TableId;
import com.atldy.commerce.commence.goods.DeductGoodsInventory;
import com.atldy.commerce.commence.goods.SimpleGoodsInfo;
import com.atldy.commerce.vo.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * <h2> 不安全的商品服务 feign接口 </h2>
 *
 * @Author: li-dong-yang
 * @CreateTime: 2021-11-04 21:56
 */
@FeignClient(contextId = "notSecureGoodsClient", value = " e-commerce-service-goods")
public interface NotSecureGoodsClient {

    /**
     * <p>扣减库存</p>
     *
     * @date: 2021/11/4 22:00
     * @param: [deductGoodsInventory]
     */
    @PostMapping("/ecommerce-service-goods/goods/deductGoodsInventory")
    CommonResponse<Boolean> deductGoodsInventory(@RequestBody List<DeductGoodsInventory> deductGoodsInventory);

    /**
     * <p>根据tableId查询商品简单信息</p>
     *
     * @date: 2021/11/4 22:11
     * @param: [tableId]
     */
    @PostMapping("/ecommerce-service-goods/goods/deductGoodsInventory")
    CommonResponse<List<SimpleGoodsInfo>> getSimpleGoodsInfos(@RequestBody TableId tableId);

}

